from scipy.optimize import minimize

# 定义目标函数
def objective(x):
    return x[0]**2 + x[1]**2 + x[2]**2

# 初始猜测
x0 = [1, 2, 3]

# 最小化
result = minimize(objective, x0)
print("Optimal solution:", result.x)
print("Minimum value:", result.fun)